package com.ctg.behavior.client.impala.config;

import org.apache.commons.pool2.impl.AbandonedConfig;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import lombok.Data;
import lombok.EqualsAndHashCode;

/***********************************************************
 * CtImpala connection object FTPAbandonedConfig
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ConfigurationProperties(prefix = "ctg.impala.abandoned")
@Component
public class CtImpalaAbandonedConfig extends AbandonedConfig {

	// 是否开启清理对象,默认关闭
	private boolean removeAbandonedOnMaintenance = true;

	// 超时时间,默认5分钟
	private int removeAbandonedTimeout = 300;

	public boolean getRemoveAbandonedOnMaintenance() {
		return this.removeAbandonedOnMaintenance;
	}

	public void setRemoveAbandonedOnMaintenance(final boolean removeAbandonedOnMaintenance) {
		this.removeAbandonedOnMaintenance = removeAbandonedOnMaintenance;
	}

	@Override
	public int getRemoveAbandonedTimeout() {
		return removeAbandonedTimeout;
	}

	@Override
	public void setRemoveAbandonedTimeout(int removeAbandonedTimeout) {
		this.removeAbandonedTimeout = removeAbandonedTimeout;
	}
}
